function APInfluenceVal = AirPressureInfluence(comNo, LocalHeight)
Height = LocalHeight;
AP_com = serial(comNo,'BaudRate',9600);
fopen(AP_com);
fwrite(AP_com,hex2dec('01'));
fwrite(AP_com,hex2dec('03'));
fwrite(AP_com,hex2dec('00'));
fwrite(AP_com,hex2dec('00'));
fwrite(AP_com,hex2dec('00'));
fwrite(AP_com,hex2dec('01'));
fwrite(AP_com,hex2dec('84'));
fwrite(AP_com,hex2dec('0a'));
AP_data = fread(AP_com,7);
pMeasured = AP_data(4)*16^2+AP_data(5);
fclose(AP_com);
% delete AP_com;
% clear AP_com;

L = 0.0065;
pNominal = 1013.25*(1-L*Height/288.15)^((9.80665*0.0289644)/(8.31447*L));
APInfluenceVal = -0.3*(pMeasured-pNominal);
end
